package org.ctstudio.oa.duty.bean;

import java.io.Serializable;
import java.time.LocalDate;
import java.time.LocalTime;

public class DutyRecord implements Serializable, UidBean {
  private static final long serialVersionUID = -5310375176744407800L;

  private LocalDate signDate;
  private String uid;
  private String userName;
  private LocalTime signInTime;
  private LocalTime signOutTime;

  public LocalDate getSignDate() {
    return signDate;
  }

  public void setSignDate(LocalDate signDate) {
    this.signDate = signDate;
  }

  public String getUid() {
    return uid;
  }

  public void setUid(String uid) {
    this.uid = uid;
  }

  public String getUserName() {
    return userName;
  }

  public void setUserName(String userName) {
    this.userName = userName;
  }

  public LocalTime getSignInTime() {
    return signInTime;
  }

  public void setSignInTime(LocalTime signInTime) {
    this.signInTime = signInTime;
  }

  public LocalTime getSignOutTime() {
    return signOutTime;
  }

  public void setSignOutTime(LocalTime signOutTime) {
    this.signOutTime = signOutTime;
  }

  private long workTimeSecond;
  private long overTimeSecond;
  private boolean late;
  private boolean early;

  public LocalTime getWorkTime() {
    return LocalTime.ofSecondOfDay(this.workTimeSecond);
  }

  public void setWorkTime(LocalTime workTime) {
    this.workTimeSecond = workTime.toSecondOfDay();
  }

  public LocalTime getOverTime() {
    return LocalTime.ofSecondOfDay(this.overTimeSecond);
  }

  public void setOverTime(LocalTime overTime) {
    this.overTimeSecond = overTime.toSecondOfDay();
  }

  public long getWorkTimeSecond() {
    return workTimeSecond;
  }

  public void setWorkTimeSecond(long workTimeSecond) {
    this.workTimeSecond = workTimeSecond;
  }

  public long getOverTimeSecond() {
    return overTimeSecond;
  }

  public void setOverTimeSecond(long overTimeSecond) {
    this.overTimeSecond = overTimeSecond;
  }

  public boolean isLate() {
    return late;
  }

  public void setLate(boolean late) {
    this.late = late;
  }

  public boolean isEarly() {
    return early;
  }

  public void setEarly(boolean early) {
    this.early = early;
  }

  public boolean isException() {
    return signInTime == null || signOutTime == null || this.late || this.early;
  }
}
